using System;
using NUnit.Framework;
using dnA.Math;

namespace dnA.dnAtests.Math 
{
	[TestFixture]
	public class ComplexMath_Float_CoshTest
	{
		[Test]
		public void Cosh()
		{
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(0.0f,1.19209289550780998537e-7f)), new ComplexFloat(9.99999999999992894573e-1f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(0.0f,-1.19209289550780998537e-7f)), new ComplexFloat(9.99999999999992894573e-1f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(0.0f,5.0e-1f)), new ComplexFloat(8.77582561890372716116e-1f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(0.0f,-5.0e-1f)), new ComplexFloat(8.77582561890372716116e-1f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(0.0f,1.0f)), new ComplexFloat(5.40302305868139717401e-1f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(0.0f,-1.0f)), new ComplexFloat(5.40302305868139717401e-1f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(0.0f,2.0f)), new ComplexFloat(-4.16146836547142386998e-1f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(0.0f,-2.0f)), new ComplexFloat(-4.16146836547142386998e-1f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(0.0f,8.388608e6f)), new ComplexFloat(-9.01754673758759322321e-1f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(0.0f,-8.388608e6f)), new ComplexFloat(-9.01754673758759322321e-1f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.19209289550780998537e-7f,0.0f)), new ComplexFloat(1.00000000000000710543f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.19209289550780998537e-7f,0.0f)), new ComplexFloat(1.00000000000000710543f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.19209289550780998537e-7f,1.19209289550780998537e-7f)), new ComplexFloat(1.0f,1.4210854715201943764e-14f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.19209289550780998537e-7f,-1.19209289550780998537e-7f)), new ComplexFloat(1.0f,-1.4210854715201943764e-14f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.19209289550780998537e-7f,1.19209289550780998537e-7f)), new ComplexFloat(1.0f,-1.4210854715201943764e-14f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.19209289550780998537e-7f,-1.19209289550780998537e-7f)), new ComplexFloat(1.0f,1.4210854715201943764e-14f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.19209289550780998537e-7f,5.0e-1f)), new ComplexFloat(8.77582561890378951715e-1f,5.71519778495077043139e-8f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.19209289550780998537e-7f,-5.0e-1f)), new ComplexFloat(8.77582561890378951715e-1f,-5.71519778495077043139e-8f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.19209289550780998537e-7f,5.0e-1f)), new ComplexFloat(8.77582561890378951715e-1f,-5.71519778495077043139e-8f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.19209289550780998537e-7f,-5.0e-1f)), new ComplexFloat(8.77582561890378951715e-1f,5.71519778495077043139e-8f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.19209289550780998537e-7f,1.0f)), new ComplexFloat(5.4030230586814355648e-1f,1.00311158276545610981e-7f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.19209289550780998537e-7f,-1.0f)), new ComplexFloat(5.4030230586814355648e-1f,-1.00311158276545610981e-7f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.19209289550780998537e-7f,1.0f)), new ComplexFloat(5.4030230586814355648e-1f,-1.00311158276545610981e-7f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.19209289550780998537e-7f,-1.0f)), new ComplexFloat(5.4030230586814355648e-1f,1.00311158276545610981e-7f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.19209289550780998537e-7f,2.0f)), new ComplexFloat(-4.16146836547145343899e-1f,1.08396700242243043298e-7f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.19209289550780998537e-7f,-2.0f)), new ComplexFloat(-4.16146836547145343899e-1f,-1.08396700242243043298e-7f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.19209289550780998537e-7f,2.0f)), new ComplexFloat(-4.16146836547145343899e-1f,-1.08396700242243043298e-7f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.19209289550780998537e-7f,-2.0f)), new ComplexFloat(-4.16146836547145343899e-1f,1.08396700242243043298e-7f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.19209289550780998537e-7f,8.388608e6f)), new ComplexFloat(-9.01754673758765729674e-1f,5.15280011006352744858e-8f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.19209289550780998537e-7f,-8.388608e6f)), new ComplexFloat(-9.01754673758765729674e-1f,-5.15280011006352744858e-8f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.19209289550780998537e-7f,8.388608e6f)), new ComplexFloat(-9.01754673758765729674e-1f,-5.15280011006352744858e-8f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.19209289550780998537e-7f,-8.388608e6f)), new ComplexFloat(-9.01754673758765729674e-1f,5.15280011006352744858e-8f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(5.0e-1f,0.0f)), new ComplexFloat(1.12762596520638078523f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-5.0e-1f,0.0f)), new ComplexFloat(1.12762596520638078523f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(5.0e-1f,1.19209289550780998537e-7f)), new ComplexFloat(1.12762596520637277296f,6.21194011561566624892e-8f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(5.0e-1f,-1.19209289550780998537e-7f)), new ComplexFloat(1.12762596520637277296f,-6.21194011561566624892e-8f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-5.0e-1f,1.19209289550780998537e-7f)), new ComplexFloat(1.12762596520637277296f,-6.21194011561566624892e-8f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-5.0e-1f,-1.19209289550780998537e-7f)), new ComplexFloat(1.12762596520637277296f,6.21194011561566624892e-8f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(5.0e-1f,5.0e-1f)), new ComplexFloat(9.89584883399919936444e-1f,2.4982639750046153149e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(5.0e-1f,-5.0e-1f)), new ComplexFloat(9.89584883399919936444e-1f,-2.4982639750046153149e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-5.0e-1f,5.0e-1f)), new ComplexFloat(9.89584883399919936444e-1f,-2.4982639750046153149e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-5.0e-1f,-5.0e-1f)), new ComplexFloat(9.89584883399919936444e-1f,2.4982639750046153149e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(5.0e-1f,1.0f)), new ComplexFloat(6.09258909157794225734e-1f,4.38486579892595275173e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(5.0e-1f,-1.0f)), new ComplexFloat(6.09258909157794225734e-1f,-4.38486579892595275173e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-5.0e-1f,1.0f)), new ComplexFloat(6.09258909157794225734e-1f,-4.38486579892595275173e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-5.0e-1f,-1.0f)), new ComplexFloat(6.09258909157794225734e-1f,4.38486579892595275173e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(5.0e-1f,2.0f)), new ComplexFloat(-4.69257978229053413027e-1f,4.73830620416406990321e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(5.0e-1f,-2.0f)), new ComplexFloat(-4.69257978229053413027e-1f,-4.73830620416406990321e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-5.0e-1f,2.0f)), new ComplexFloat(-4.69257978229053413027e-1f,-4.73830620416406990321e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-5.0e-1f,-2.0f)), new ComplexFloat(-4.69257978229053413027e-1f,4.73830620416406990321e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(5.0e-1f,8.388608e6f)), new ComplexFloat(-1.01684198437658599569f,2.2524250900412912476e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(5.0e-1f,-8.388608e6f)), new ComplexFloat(-1.01684198437658599569f,-2.2524250900412912476e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-5.0e-1f,8.388608e6f)), new ComplexFloat(-1.01684198437658599569f,-2.2524250900412912476e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-5.0e-1f,-8.388608e6f)), new ComplexFloat(-1.01684198437658599569f,2.2524250900412912476e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.0f,0.0f)), new ComplexFloat(1.54308063481524377848f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.0f,0.0f)), new ComplexFloat(1.54308063481524377848f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.0f,1.19209289550780998537e-7f)), new ComplexFloat(1.54308063481523281423f,1.40094899373507046038e-7f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.0f,-1.19209289550780998537e-7f)), new ComplexFloat(1.54308063481523281423f,-1.40094899373507046038e-7f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.0f,1.19209289550780998537e-7f)), new ComplexFloat(1.54308063481523281423f,-1.40094899373507046038e-7f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.0f,-1.19209289550780998537e-7f)), new ComplexFloat(1.54308063481523281423f,1.40094899373507046038e-7f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.0f,5.0e-1f)), new ComplexFloat(1.35418065670458429296f,5.63421465230981780955e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.0f,-5.0e-1f)), new ComplexFloat(1.35418065670458429296f,-5.63421465230981780955e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.0f,5.0e-1f)), new ComplexFloat(1.35418065670458429296f,-5.63421465230981780955e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.0f,-5.0e-1f)), new ComplexFloat(1.35418065670458429296f,5.63421465230981780955e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.0f,1.0f)), new ComplexFloat(8.33730025131149048884e-1f,9.88897705762865096382e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.0f,-1.0f)), new ComplexFloat(8.33730025131149048884e-1f,-9.88897705762865096382e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.0f,1.0f)), new ComplexFloat(8.33730025131149048884e-1f,-9.88897705762865096382e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.0f,-1.0f)), new ComplexFloat(8.33730025131149048884e-1f,9.88897705762865096382e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.0f,2.0f)), new ComplexFloat(-6.42148124715519964845e-1f,1.0686074213827783396f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.0f,-2.0f)), new ComplexFloat(-6.42148124715519964845e-1f,-1.0686074213827783396f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.0f,2.0f)), new ComplexFloat(-6.42148124715519964845e-1f,-1.0686074213827783396f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.0f,-2.0f)), new ComplexFloat(-6.42148124715519964845e-1f,1.0686074213827783396f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.0f,8.388608e6f)), new ComplexFloat(-1.39148017443127938564f,5.07978603242576038333e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(1.0f,-8.388608e6f)), new ComplexFloat(-1.39148017443127938564f,-5.07978603242576038333e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.0f,8.388608e6f)), new ComplexFloat(-1.39148017443127938564f,-5.07978603242576038333e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-1.0f,-8.388608e6f)), new ComplexFloat(-1.39148017443127938564f,5.07978603242576038333e-1f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(2.0f,0.0f)), new ComplexFloat(3.76219569108363145956f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-2.0f,0.0f)), new ComplexFloat(3.76219569108363145956f,0.0f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(2.0f,1.19209289550780998537e-7f)), new ComplexFloat(3.76219569108360472755f,4.32355452519297901029e-7f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(2.0f,-1.19209289550780998537e-7f)), new ComplexFloat(3.76219569108360472755f,-4.32355452519297901029e-7f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-2.0f,1.19209289550780998537e-7f)), new ComplexFloat(3.76219569108360472755f,-4.32355452519297901029e-7f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-2.0f,-1.19209289550780998537e-7f)), new ComplexFloat(3.76219569108360472755f,4.32355452519297901029e-7f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(2.0f,5.0e-1f)), new ComplexFloat(3.30163733291409455749f,1.73880950447431633438f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(2.0f,-5.0e-1f)), new ComplexFloat(3.30163733291409455749f,-1.73880950447431633438f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-2.0f,5.0e-1f)), new ComplexFloat(3.30163733291409455749f,-1.73880950447431633438f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-2.0f,-5.0e-1f)), new ComplexFloat(3.30163733291409455749f,1.73880950447431633438f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(2.0f,1.0f)), new ComplexFloat(2.03272300701966552944f,3.05189779915180005751f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(2.0f,-1.0f)), new ComplexFloat(2.03272300701966552944f,-3.05189779915180005751f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-2.0f,1.0f)), new ComplexFloat(2.03272300701966552944f,-3.05189779915180005751f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-2.0f,-1.0f)), new ComplexFloat(2.03272300701966552944f,3.05189779915180005751f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(2.0f,2.0f)), new ComplexFloat(-1.56562583531574337406f,3.29789483631123661773f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(2.0f,-2.0f)), new ComplexFloat(-1.56562583531574337406f,-3.29789483631123661773f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-2.0f,2.0f)), new ComplexFloat(-1.56562583531574337406f,-3.29789483631123661773f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-2.0f,-2.0f)), new ComplexFloat(-1.56562583531574337406f,3.29789483631123661773f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(2.0f,8.388608e6f)), new ComplexFloat(-3.39257754802973015548f,1.56770389112823016984f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(2.0f,-8.388608e6f)), new ComplexFloat(-3.39257754802973015548f,-1.56770389112823016984f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-2.0f,8.388608e6f)), new ComplexFloat(-3.39257754802973015548f,-1.56770389112823016984f), 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Cosh(new ComplexFloat(-2.0f,-8.388608e6f)), new ComplexFloat(-3.39257754802973015548f,1.56770389112823016984f), 1e-7f);
		}
	}
}
